package com.sevennotes.classtable.model

import androidx.room.*
import java.io.Serializable

@Entity(tableName = "class_items")
data class ClassItem(
    @PrimaryKey(autoGenerate = true) var id: Int? = null,
    @ColumnInfo(name = "student_id") var studentId: Int = 0,
    @ColumnInfo(name = "week_day") var weekDay: Int = 0,
    @Embedded var startTime: Time = Time(0, 0),
    @ColumnInfo(name = "duration") var duration: Int = 0,
    @ColumnInfo(name = "table_id") var tableId: Int = 0
) : Serializable {
    companion object {
        private const val serialVersionUID = 1L
    }
}

@Entity
data class ClassItemWithName(
    @Embedded var classItem: ClassItem,
    @ColumnInfo(name = "student_name") var studentName: String = "",
    @ColumnInfo(name = "student_color") var studentColor: Int? = null
)
